{% extends 'common/base.html' %}
{% block title %}
    首页
{% endblock %}
{% block page_content %}
    <div class="row">
        <div class="col-md-1"></div>
        <div class="col-md-10" style="text-align: center">
            {{ wtf.quick_form(form) }}
            <br>
            <div class="mycontent" style="width: 100%;height: 100%;text-align: left;">
                {% for post in allposts.items %}
                    <div class="list-group" style="width: 100%;">
                        <a href="#" class="list-group-item active" style="overflow: hidden;width: 100%;position: relative;">
                            <h4 class="list-group-item-heading" style="width: 80%;">{{ post.content }}</h4>
{#                 定制时间输出的格式，并且自动更正时区，这里的LLL输出格式化后的年月日时分秒#}
{#                            可以使用YY年MM月DD日#}
                            <p style="width: 80%;">发帖时间：{{ moment(post.timestamp).format('LLL') }}</p>
                            <p style="float: right">-->发帖人：{{ post.user.username }}</p>
                            <div class="usericon" style="float:right;width: 64px;height: 64px;right: 0;top:0;position: absolute;">
                                <img src="{{ url_for('static',filename='upload/'+post.user.icon) }}" title="用户头像" style="width: 64px;height: 64px;">
                            </div>

                        </a>
                    </div>
                {% endfor %}
            </div>
            {% for p in range(0,pages) %}
                <a href="{{ url_for('main.index_two',yema=p + 1,_external=True)}}"><p style="display: inline-block;width: 30px;height: 30px;text-align: center;line-height: 30px;border: 1px solid #ccc;">{{ p + 1 }}</p></a>
            {% endfor %}
        </div>
        <div class="col-md-1"></div>
    </div>

{% endblock %}